import { http } from "@/utils/http";

export type GetCaptchaBase64Result = {
  code: number;
  msg: string;
  data: {
    base64: string;
  };
};
export type AnFileUploadResult = {
  code: number;
  msg: string;
  data: {
    filepath: string;
    filename: string;
  };
};
export const getCaptchaBase64 = (data: string) => {
  return http.request<GetCaptchaBase64Result>(
    "get",
    "/api/Captcha/GetCaptchaBase64?id=" + data
  );
};

export const anFileUpload = (data: any) => {
  return http.request<AnFileUploadResult>(
    "post",
    "/api/FileUpload/AnFileUpload",
    {
      data
    },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
};
